AI Service
Overview
The AI Service adds an intelligent assistant layer to ALP-CONNEX. It connects to live process data and a customizable knowledge base to provide natural-language explanations, trend analysis, operational recommendations, and free-form Q&A — all in the context of your actual infrastructure.
Key Features
Chat Assistant
A conversational interface for asking questions about your plant or infrastructure:
- Ask free-form questions like "What is the current state of Transformer 1?"
- Tie questions to a specific datapoint for context-aware answers
- Responses can be streamed in real-time (for UIs) or returned as a single JSON response
- The assistant automatically incorporates relevant knowledge base documents and live signal data into its answers
Signal Explanation
Get a plain-language explanation of any datapoint in your process image:
- What the signal represents
- Its current value and trend
- What the current reading means in operational context
Useful for operators who need to quickly understand unfamiliar signals without looking up documentation manually.
Trend Analysis
Perform automated analysis of a signal over a configurable time window:
- Computed statistics: count, min, max, mean, standard deviation, trend direction
- AI-generated interpretation of the data pattern
- Detection and listing of anomalies
Default analysis window is 60 minutes, but can be adjusted per request.
Operational Recommendations
Request structured, actionable recommendations for a specific datapoint situation:
- Severity classification
- Short summary of the situation
- Prioritized list of recommended actions with rationale
- References to relevant knowledge base documents (if available)
Ideal for decision support when operators encounter unusual readings or warning conditions.
Process Image Summary
Get a high-level overview of the entire process image in one request:
- All currently available datapoints
- Total datapoint count
- AI-generated summary of the overall plant/process state
Knowledge Base
Build and maintain a domain-specific knowledge base that the AI uses to ground its answers:
- Upload documents — PDF, Markdown, CSV, and TXT files are supported
- Documents are automatically split into chunks and indexed for retrieval
- The AI references relevant knowledge chunks when answering questions, generating explanations, or making recommendations
- Check status — see the collection name and number of indexed chunks
- Reset — clear and rebuild the knowledge base when needed
The knowledge base is the primary mechanism for tailoring the AI to your specific infrastructure. Upload your operating procedures, threshold definitions, equipment manuals, switching rules, or site-specific guidelines — the AI will use this domain knowledge to produce more relevant explanations and more actionable recommendations.
System Configuration via Chat
The AI assistant can directly create, update, and delete resources in the Management API on your behalf. Instead of navigating the UI manually, you can instruct the AI in natural language:
- Connectors — Create, read, update, and delete MQTT, IEC 104, and REST connectors
- Signals — Create, read, update, and delete IEC 104 address points
- Mappings — Create, read, update, and delete data point mappings (MQTT and REST)
Examples:
- "Create an MQTT connector called 'Weather Station' on port 1883"
- "Add a signal for temperature at CASDU 225, IOA 100, Type 36"
- "Create a mapping that extracts data.temperature from topic sensors/weather"
- "List all connectors and their status"
- "Delete the mapping named 'old-sensor'"
Safety: Destructive operations (delete, update) require explicit confirmation before execution. Read and create operations proceed immediately.
Debug / Inspection
A debug mode for the chat endpoint that shows how the AI arrived at its answer:
- Which knowledge chunks were retrieved
- Similarity scores for each chunk
- The full prompt that was sent to the AI
- Useful for validating answer quality and tuning the knowledge base
Configuration
| Setting | Required | Description |
|---|---|---|
LLM_PROVIDER | Yes | Which AI backend to use |
LLM_MAX_TOKENS | No | Maximum response length |
| Live data connection | Yes | Host and port of the process data store |
| Knowledge store connection | Yes | Host and port of the knowledge base backend |
| Model selection | No | Choose which model to use (depends on provider) |
Troubleshooting
Health Check
The health endpoint reports whether all required services are reachable:
GET /api/ai/health
It shows connectivity status for:
- AI response backend
- Knowledge store
- Live data source
No Knowledge Results
If the AI doesn't reference uploaded documents:
- Check knowledge status — are chunks indexed?
- Try the debug endpoint to see retrieved chunks and similarity scores
- Re-upload or reindex if documents were changed
Streaming Not Working
The chat endpoint streams responses by default (SSE). If your client doesn't support streaming, send an Accept: application/json header to receive the full response as JSON instead.